﻿
Namespace Negocios

    Public Class Usuario

#Region "Variáveis"


#End Region

#Region "Propriedades"


#End Region

#Region "Construtores"


#End Region

#Region "Funções Privadas"

        Private Function CriptografaSenha(ByVal strSenha As String) As String

            Return Geral.Geral.Criptografa(strSenha)

        End Function

#End Region

#Region "Funções Friend"

#End Region

#Region "Funções Públicas"

        Public Sub Salvar(ByVal objUsuario As Objetos.Usuarios)

            Dim objConexao As New Dados.Conexao

            Dim strQuery As String

            strQuery = String.Format("INSERT INTO Usuarios (Nome, NomeUsuario, Email, Senha) VALUES ('{0}','{1}','{2}','{3}')", _
                                     objUsuario.Nome, objUsuario.NomeUsuario.ToUpper, objUsuario.Email, objUsuario.Senha)

            'strQuery = "INSERT INTO Usuarios"
            'strQuery &= "(Nome, NomeUsuario, Email, Senha) "
            'strQuery &= "VALUES "
            'strQuery &= String.Format("('{0}','{1}','{2}','{3}')", objUsuario.Nome, objUsuario.NomeUsuario.ToUpper, objUsuario.Email, objUsuario.Senha)

            objConexao.Inserir(strQuery)

        End Sub

#End Region

    End Class

End Namespace